// electron.vite.config.ts
import { defineConfig, externalizeDepsPlugin } from "electron-vite";

// vite.config.js
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
import AutoImport from "unplugin-auto-import/vite";
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
import Components from "unplugin-vue-components/vite";
import VueSetupExtend from "vite-plugin-vue-setup-extend";
import UnoCSS from "unocss/vite";
var __electron_vite_injected_dirname = "D:\\VarietiesDocs\\CodeStatup\\Web\\electron\\auto-project-axure";
var publicDir = resolve("resources");
var envDir = resolve("build");
var config = {
  publicDir,
  envDir,
  envPrefix: "VITE_ELECTRON",
  base: "./",
  // "/" 表示相对于域名的根路径， "./" 表示资源所在文件夹的相对路径
  plugins: [
    vue(),
    AutoImport({
      resolvers: [AntDesignVueResolver()],
      imports: ["vue", "vue-router"]
    }),
    Components({
      resolvers: [
        AntDesignVueResolver({
          importStyle: false
          // css in js
        })
      ]
    }),
    VueSetupExtend(),
    UnoCSS()
  ],
  build: {
    terserOptions: {
      compress: {
        drop_console: true
      }
    },
    minify: "terser"
    // 小于以下值得的图片会自动转换为 base64 图片
    // assetsInlineLimit: 4096,
    // 是否将 import() 分割后的模块的 css 全部打包到一个文件中
    // cssCodeSplit: false
  },
  resolve: {
    alias: {
      "@": resolve(__electron_vite_injected_dirname, "./src/renderer/src")
    }
  }
  // server: {
  //   proxy: {
  //     '': {
  //       target: 'https://www.axshare.com',
  //       changeOrigin: true,
  //       rewrite: (path) => path.replace(/^\/api/, '')
  //     }
  //   }
  // },
};
var vite_config_default = config;

// electron.vite.config.ts
import { resolve as resolve2 } from "path";
var electron_vite_config_default = defineConfig({
  main: {
    envPrefix: "MAIN_",
    resolve: {
      alias: {
        "@main": resolve2("src/main"),
        "@build": resolve2("build"),
        "@resources": resolve2("resources")
      }
    },
    plugins: [externalizeDepsPlugin()]
  },
  preload: {
    plugins: [externalizeDepsPlugin()]
  },
  renderer: vite_config_default
});
export {
  electron_vite_config_default as default
};
